{extend name='public/form'/}
{block name='fields'}
{:token_field()}
<input type="hidden" name="id" value="{$row['id']}">
<div class="layui-form-item">
    <label class="layui-form-label">字段名</label>
    <div class="layui-input-inline">
        <select name="sid" lay-verify="required">
            <option value=""></option>
            {foreach $setting as $key => $vo}
            <option value="{$key}" {if $key==$row['sid']} selected{/if}>{$vo}</option>
            {/foreach}
        </select>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">标签名</label>
    <div class="layui-input-block">
        <input type="text" name="label" value="{$row['label']}" autocomplete="off" class="layui-input">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">类型</label>
    <div class="layui-input-inline">
        <select name="type" lay-verify="required">
            <option value=""></option>
            <option value="text" {$row['type']=='text' ? 'selected' :''}>文本框</option>
            <option value="password" {$row['type']=='password' ? 'selected' :''}>密码框</option>
            <option value="number" {$row['type']=='number' ? 'selected' :''}>数字框</option>
            <option value="textarea" {$row['type']=='textarea' ? 'selected' :''}>文本域</option>
            <option value="upload" {$row['type']=='upload' ? 'selected' :''}>上传框</option>
            <option value="color" {$row['type']=='color' ? 'selected' :''}>颜色框</option>
            <option value="date" {$row['type']=='date' ? 'selected' :''}>日期框</option>
            <option value="select" {$row['type']=='select' ? 'selected' :''}>选择框</option>
            <option value="radio" {$row['type']=='radio' ? 'selected' :''}>单选框</option>
            <option value="checkbox" {$row['type']=='checkbox' ? 'selected' :''}>复选框</option>
            <option value="switch" {$row['type']=='switch' ? 'selected' :''}>开关</option>
            <option value="editor" {$row['type']=='editor' ? 'selected' :''}>layEditor</option>
            <option value="weditor" {$row['type']=='weditor' ? 'selected' :''}>wangEditor</option>
        </select>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">名称</label>
    <div class="layui-input-block">
        <input type="text" name="name" value="{$row['name']}" required lay-verify="required" placeholder="请输入名称"
            autocomplete="off" class="layui-input">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-block">
        <input type="text" name="value" value="{$row['value']}" autocomplete="off" class="layui-input">
    </div>
</div>
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">options</label>
    <div class="layui-input-block">
        <textarea name="options" class="layui-textarea" placeholder="选择框、单选框和复选框及默认值填写json字符串">{$row['options']}</textarea>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">描述信息</label>
    <div class="layui-input-block">
        <input type="text" name="desc" value="{$row['desc']}" autocomplete="off" class="layui-input">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-inline">
        <input type="number" name="ord" value="{$row['ord']}" required lay-verify="required|max:4" placeholder="请输入排序"
            autocomplete="off" class="layui-input">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-block">
        <input type="hidden" name="status" value="1">
        <input type="checkbox" name="status" value="0" {$row['status']==0 ? 'checked' :''} lay-text="开启|禁用"
            lay-skin="switch">
    </div>
</div>
{/block}